package com.the9.C9Alarm;





import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;

import com.openfeint.api.OpenFeint;
import com.openfeint.api.OpenFeintDelegate;
import com.openfeint.api.OpenFeintSettings;

public class SplashScreen extends Activity {
    protected boolean _active = true;
    protected int _splashTime = 2000;
    boolean ismm = false;
   
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 
        setContentView(R.layout.splash9c);
        iniRes();
        Thread splashTread = new Thread() {
            @Override
            public void run() {
                try {
                 //   int waited = 0;
                 //   while((waited < _splashTime)) {
                 //       sleep(100);
                //        if(_active) {
                	
                           
                  //      }
               //         waited += 100;
        //            }
                } catch(Exception e) {
                    // do nothing
                	e.printStackTrace();
                } finally {
                	
                	startActivity(new Intent(SplashScreen.this,boxAlarmActivity.class));

                    finish();
                    // 启动主应用
                   
                    {
                    	                    }
                    _active=false;
                }
            }
        };
        splashTread.start();
    }
    
    static final String gameID = "1060318632";
	static final String gameKey = "QcnONvB0fTZhfO71khUuA";
	static final String gameSecret = "p2gLs0kFMvF6xYLHSisFzU58izi7rxAf";
	

	
	
    public void iniRes() {
       

        /*//�������Ҫ�Զ���һЩOpenFeintSettings�Ĳ���		
        Map<String, Object> options = new HashMap<String, Object>();
		options.put(OpenFeintSettings.SettingCloudStorageCompressionStrategy,
				OpenFeintSettings.CloudStorageCompressionStrategyDefault);
        OpenFeintSettings settings = new OpenFeintSettings(AppName,
				Product_Key, Product_Secret, Client_Application_ID, options);
         */
        
        OpenFeintSettings settings = new OpenFeintSettings("闹钟",
        		gameKey, gameSecret, gameID);
    	OpenFeint.initializeWithoutLoggingIn(this, settings, new OpenFeintDelegate() {});
    	
    	Form.inialize(this);
    	_active=false;
    	Log.e("inial", "over");
    	Media.getInstance(this);
    }
    
    
}